import flash.MovieClip;
import flash.Key;

class Workingmc
{

    static function main() {
          var Bfield : Array<Array<MovieClip>>;
          Bfield = new Array<Array<MovieClip>>();
          var mc = flash.Lib.current.attachMovie("gt1","s",121);
		  //mc.stop();
		  mc._width = 20;
		  mc._height = 20;
          for(i in 0...11)
          {
			   Bfield[i] = new Array<MovieClip>();
               for(j in 0...11)
               {
                    Bfield[i][j] = flash.Lib.current.attachMovie("mc_square","s",i*11+j);
                    Bfield[i][j]._x = i*20;
                    Bfield[i][j]._y = j*20;
					Bfield[i][j]._alpha = 50+50*((i*j)%2);
               }
          }
		  mc.onEnterFrame = function() {
			  if(Key.isDown(65)&&(mc._x>0)&&(mc._y%40==0)){
				  mc._x -=10;
			  }
			  if(Key.isDown(68)&&(mc._x<200)&&(mc._y%40==0)){
				  mc._x +=10;
			  }
			  if(Key.isDown(87)&&(mc._y>0)&&(mc._x%40==0)){
				  mc._y -=10;
			  }
			  if(Key.isDown(83)&&(mc._y<200)&&(mc._x%40==0)){
				  mc._y +=10;
			  }
			  if(Key.isDown(81)&&(mc._y<200)&&(mc._x%40==0)){
				  mc.gotoAndPlay(2);
			  }
		  }
	}
	
}
